package cn.bellychang.leetcode.question876;

/**
 * @author ChangLiang
 * @date 2021/3/7
 */
public class Solution3 {

    public ListNode middleNode(ListNode head) {

        ListNode fast = head;
        ListNode slow = head;
        while(fast!=null && fast.next!=null){
            fast = fast.next.next;
            slow = slow.next;
        }
        return slow;
    }
}
